import os
import json

# 获取模块所在目录（'..../yoka-main'）
ROOT_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# 用户和用户组配置
ALGORITHM = "HS256"
SECRET_KEY = "asnuia81289SD@#$()@(@!##"  # 用户密码加密密钥
ACCESS_TOKEN_EXPIRE_MINUTES = 60 * 6  # 用户 token 有效期
REFRESH_DELTA_MINUTES = 60 * 3  # 刷新delta 时间
GUEST_GROUP_ID = 4  # 游客 用户组ID
GUEST_DEFAULT_VALIDITY_PERIOD = 3  # 游客默认有效时长, 单位：天
GROUP_DEFAULT_VALIDITY_PERIOD = 5  # 用户组默认有效时长, 单位：年

# es 索引映射文件
ES_INDEX_DEFAULT_MAPPING_PATH = os.path.join(ROOT_PATH, "configs", "json_files", "mappings.json")

# 公司类型和岗位类型文件
JOB_COMPANY_LIST_FILE = os.path.join(ROOT_PATH, "configs", "json_files", "job_list.json")

# 近义词存储文件路径
QUERY_TRANS_DATA_FILE = os.path.join(ROOT_PATH, "configs", "json_files", "query_trans_data.json")
# 用户上传近义词存储文件路径
USER_QUERY_TRANS_DATA_FILE = os.path.join(ROOT_PATH, "configs", "json_files", "user_query_trans_data.json")
# 推荐问题存储文件路径
RECOMMEND_QUESTION_DATA_FILE = os.path.join(ROOT_PATH, "configs", "json_files", "recommend_questions.json")
# 用户推荐问题存储文件路径
USER_RECOMMEND_QUESTION_DATA_FILE = os.path.join(ROOT_PATH, "configs", "json_files", "user_recommend_questions.json")

# 短信验证
ALIBABA_CLOUD_ACCESS_KEY_ID = os.getenv('ALIBABA_CLOUD_ACCESS_KEY_ID')
ALIBABA_CLOUD_ACCESS_KEY_SECRET = os.getenv('ALIBABA_CLOUD_ACCESS_KEY_SECRET')
ALIYUN_SMS_SIGN_NAME = os.getenv('ALIYUN_SMS_SIGN_NAME')
ALIYUN_SMS_TEMPLATE_CODE = os.getenv('ALIYUN_SMS_TEMPLATE_CODE')

# 微信小程序配置
WX_APP_ID = os.getenv('WX_APP_ID')
WX_APP_SECRET = os.getenv('WX_APP_SECRET')
WX_TOKEN_URL = os.getenv('WX_TOKEN_URL')
WX_PHONE_URL = os.getenv('WX_PHONE_URL')
